import type { RouteRecordRaw } from "vue-router";
import { markRaw } from "vue";
/**
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单栏及 tagsView 栏、菜单搜索名称（国际化）
 *      hidden：        是否隐藏此路由
 *      icon：          菜单、tagsView 图标，阿里：加 `iconfont xxx`，fontawesome：加 `fa xxx`
 * }
 */

/**
 * 静态路由（默认路由）
 */
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from "@element-plus/icons-vue";
export const asyncRoute: any = [
  {
    path: "/HomePage",
    name: "XHomePage",
    title: "首页",
    icon: markRaw(Setting),
    permission: "oms/HomePage",
    component: () => import("@/views/HomePage/index.vue"),
    meta: {
      hidden: true,
    },
  },
  {
    path: "/demo",
    name: "XDemo",
    title: "测试页面",
    icon: markRaw(Document),
    permission: "oms/demo",
    children: [
      {
        path: "/demo/demo1",
        name: "XDemo1",
        title: "游戏列表",
        permission: "oms/demo1",
        component: () => import("@/views/Demo/Demo1/index.vue"),
      },
      {
        path: "/demo/demo2",
        name: "XDemo2",
        title: "测试22",
        permission: "oms/demo2",
        component: () => import("@/views/Demo/Demo2/index.vue"),
      },
      {
        path: "/demo/demo3",
        title: "测试33",
        permission: "oms/demo3",
        children: [
          {
            path: "/demo/demo3/brand",
            name: "XBrand",
            title: "品牌",
            permission: "oms/brand",
            component: () => import("@/views/Demo/Demo3/brand.vue"),
          },
          {
            path: "/demo/demo3/order",
            name: "XOder",
            title: "订单",
            permission: "oms/order",
            component: () => import("@/views/Demo/Demo3/order.vue"),
          },
        ],
      },
      {
        path: "/demo/demo4",
        name: "XDemo4",
        title: "推拽",
        permission: "oms/demo2",
        component: () => import("@/views/Demo/Demo4/index.vue"),
      },
    ],
  },
  {
    path: "/antdv",
    name: "antdv6",
    title: "antdv6",
    icon: markRaw(Document),
    permission: "oms/antdv",
    children: [
      {
        path: "/antdv1",
        name: "antdv1",
        title: "antdv1",
        icon: markRaw(Document),
        permission: "oms/antdv1",
        component: () => import("@/views/antdv/ant1/index.vue"),
      },
      {
        path: "/antdv2",
        name: "antdv2",
        title: "antdv2",
        icon: markRaw(Document),
        permission: "oms/antdv1",
        component: () => import("@/views/antdv/ant2/index.vue"),
      },
      {
        path: "/svg",
        name: "svg",
        title: "svg",
        icon: markRaw(Document),
        permission: "oms/svg",
        component: () => import("@/views/antdv/svg/index.vue"),
      },
    ],
  },
];

export const asyncRouteObj = {
  path: "/home",
  name: "XHome",
  component: () => import("@/views/Home/index.vue"),
  meta: {
    hidden: true,
  },
  children: [],
};
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/login",
    component: () => import("@/views/Login/index.vue"),
    meta: {
      hidden: true,
    },
    children: [],
  },
  {
    path: "/login",
    name: "XLogin",
    component: () => import("@/views/Login/index.vue"),
    meta: {
      hidden: true,
    },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/Error/404.vue"),
    meta: {
      hidden: true,
    },
  },
  asyncRouteObj,
  /* 匹配任意的路由 必须最后注册 */
  // {
  //   path: "/:pathMatch(.*)",
  //   name: "Any",
  //   redirect: "/404",
  //   meta: {
  //     hidden: true,
  //   },
  // },
];

/**
 * 定义动态路由
 */
// export const allAsyncRoutes: Array<RouteRecordRaw> = [];
